package battleroom.server;

import battleroom.common.Constants;
import com.jme3.app.SimpleApplication;
import com.jme3.network.Network;
import com.jme3.network.Server;
import com.jme3.system.JmeContext;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author TJ
 */
public class ServerMain extends SimpleApplication {
    private Server server;
    
    public static void main(String[] args) {
        ServerMain app = new ServerMain();
        app.start(JmeContext.Type.Headless);
    }

    @Override
    public void simpleInitApp() {
        try {
            server = Network.createServer(Constants.GAME_NAME, Constants.GAME_VERSION,
                    Constants.NETWORK_PORT, Constants.NETWORK_PORT);
        } catch (IOException ex) {
            Logger.getLogger(ServerMain.class.getName()).log(Level.SEVERE, null, ex);
        }
        server.start();
    }
    
    @Override
    public void simpleUpdate(float tpf) {
        
    }
}
